home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 4239 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.5 KB

  1. Path: gatekeeper.liffe.com!usenet
  2. From: ralph.mason@liffe.com (Ralph Mason)
  3. Newsgroups: comp.sys.cbm,comp.os.misc,alt.comp.hardware.homebuilt,comp.sys.apple2,comp.sys.apple2.programmer,comp.sys.atari.8bit
  4. Subject: Re: 6502 Multitasking OS announce
  5. Date: Tue, 19 Mar 1996 16:36:39 GMT
  6. Organization: London International Financial Futures Exchange
  7. Message-ID: <4imo7b$36m@gatekeeper.liffe.com>
  8. References: <4i94fs$stj@narses.hrz.tu-chemnitz.de> <holger.948.00030EE6@deep.hb.provi.de> <4ijtbe$7ca@no-names.nerdc.ufl.edu> <4ijuic$iiq@gatekeeper.liffe.com> <4ik00v$9r@fishlab7.fsh.mtu.edu> <4im8k0$gud@gatekeeper.liffe.com> <4iml11$s69@narses.hrz.tu-chemnitz.de>
  9. Reply-To: ralph.mason@liffe.com
  10. NNTP-Posting-Host: ralph_pc.liffe.com
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. fachat@physik.tu-chemnitz.de (Andre Fachat) wrote:
  14.   
  15. >To share code between processes, you need not put the parameter on the
  16. >stack. The shell, e.g. is in the ROM. The same program can run several 
  17. >times in different tasks without any problem. This works because
  18. >the used RAM is mapped to different pages for different tasks. 
  19. >You can also load an executable into some RAM and let two tasks share this
  20. >RAM. As long as they don't write to it, there's no problem. For writing
  21. >they use the task specific RAM.
  22.  
  23. You have sorta missed what I was meaning here.  Sure you can map code
  24. around here and there - but if many processes are going to use the
  25. same routines the routienes better not use any global data.  These
  26. routine should use the stack for any working data. I guess you use no
  27. absolute jumps :-)
  28.  
  29.  
  30. >reentrant routines - well, the kernel is in some respect reentrant.
  31. >internal kernel routines call other kernel routines via the same 
  32. >interface as other 'user' routines as well. The kernel entry/exit gates 
  33. >detect this and do not change the memory mapping. 
  34. >Devices, that have their own memory mapping and that are called via
  35. >the DEVCMD interface call kernel routines. 
  36. >But then only some routines are a kind of reentrant, esp. the STREAM routines.
  37. >They disable Multitasking during their critical sections. The problem
  38. >with the C64 is, that is doesn't have atomic test&set operations. So all
  39. >task switches have to be disabled to test a semaphore, or when you enter
  40. >a critical region.
  41.  
  42.  
  43. what about a eor ?  
  44.  
  45. you pass in the critial section as the adress and eor that adress with
  46. say 1
  47.  
  48. if
  49.  
  50. wait:
  51.     cmp addr,0
  52.     beq get
  53.     call scheduler yeild function
  54.     jmp wait
  55. get: 
  56.     eor addr,1
  57.     jz wait
  58.  
  59. ..you should have the critical section here
  60.  
  61.  
  62. -Ralph Maosn
  63.  
  64.  
  65.